home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxfont1.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  5.0 KB  |  159 lines

  1. /* Copyright (C) 1994, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxfont1.h,v 1.4 2000/09/19 19:00:37 lpd Exp $ */
  20. /* Type 1 / Type 2 font data definition */
  21.  
  22. #ifndef gxfont1_INCLUDED
  23. #  define gxfont1_INCLUDED
  24.  
  25. #include "gstype1.h"        /* for charstring_interpret_proc */
  26. #include "gxfixed.h"
  27.  
  28. /*
  29.  * This is the type-specific information for Adobe Type 1 fonts.
  30.  * It also includes the information for Type 2 fonts, because
  31.  * there isn't very much of it and it's less trouble to include here.
  32.  */
  33.  
  34. #ifndef gs_font_type1_DEFINED
  35. #  define gs_font_type1_DEFINED
  36. typedef struct gs_font_type1_s gs_font_type1;
  37. #endif
  38.  
  39. /*
  40.  * The zone_table values should be ints, according to the Adobe
  41.  * specification, but some fonts have arbitrary floats here.
  42.  */
  43. #define zone_table(size)\
  44.     struct {\
  45.         int count;\
  46.         float values[(size)*2];\
  47.     }
  48. #define float_array(size)\
  49.     struct {\
  50.         int count;\
  51.         float values[size];\
  52.     }
  53. #define stem_table(size)\
  54.     float_array(size)
  55.  
  56. typedef struct gs_type1_data_s gs_type1_data;
  57.  
  58. typedef struct gs_type1_data_procs_s {
  59.  
  60.     /* Get the data for any glyph. */
  61.  
  62.     int (*glyph_data) (P3(gs_font_type1 * pfont, gs_glyph glyph,
  63.               gs_const_string * pgdata));
  64.  
  65.     /* Get the data for a Subr. */
  66.  
  67.     int (*subr_data) (P4(gs_font_type1 * pfont, int subr_num, bool global,
  68.              gs_const_string * psdata));
  69.  
  70.     /*
  71.      * Get the data for a seac character, including the glyph and/or the
  72.      * outline data.  Any of the pointers for the return values may be 0,
  73.      * indicating that the corresponding value is not needed.
  74.      */
  75.  
  76.     int (*seac_data) (P4(gs_font_type1 * pfont, int ccode,
  77.              gs_glyph * pglyph, gs_const_string * pcdata));
  78.  
  79.     /*
  80.      * Push (a) value(s) onto the client ('PostScript') stack during
  81.      * interpretation.  Note that this procedure and the next one take a
  82.      * closure pointer, not the font pointer, as the first argument.
  83.      */
  84.  
  85.     int (*push_values)(P3(void *callback_data, const fixed *values,
  86.               int count));
  87.  
  88.     /* Pop a value from the client stack. */
  89.  
  90.     int (*pop_value)(P2(void *callback_data, fixed *value));
  91.  
  92. } gs_type1_data_procs_t;
  93.  
  94. /*
  95.  * The garbage collector really doesn't want the client data pointer
  96.  * from a gs_type1_state to point to the gs_type1_data in the middle of
  97.  * a gs_font_type1, so we make the client data pointer (which is passed
  98.  * to the callback procedures) point to the gs_font_type1 itself.
  99.  */
  100. struct gs_type1_data_s {
  101.     /*int PaintType; *//* in gs_font_common */
  102.     gs_type1_data_procs_t procs;
  103.     charstring_interpret_proc((*interpret));
  104.     void *proc_data;        /* data for procs */
  105.     int lenIV;            /* -1 means no encryption */
  106.                 /* (undocumented feature!) */
  107.     uint subroutineNumberBias;    /* added to operand of callsubr */
  108.                 /* (undocumented feature!) */
  109.     /* Type 2 additions */
  110.     uint gsubrNumberBias;    /* added to operand of callgsubr */
  111.     long initialRandomSeed;
  112.     fixed defaultWidthX;
  113.     fixed nominalWidthX;
  114.     /* End of Type 2 additions */
  115.     /* For a description of the following hint information, */
  116.     /* see chapter 5 of the "Adobe Type 1 Font Format" book. */
  117.     int BlueFuzz;
  118.     float BlueScale;
  119.     float BlueShift;
  120. #define max_BlueValues 7
  121.           zone_table(max_BlueValues) BlueValues;
  122.     float ExpansionFactor;
  123.     bool ForceBold;
  124. #define max_FamilyBlues 7
  125.     zone_table(max_FamilyBlues) FamilyBlues;
  126. #define max_FamilyOtherBlues 5
  127.     zone_table(max_FamilyOtherBlues) FamilyOtherBlues;
  128.     int LanguageGroup;
  129. #define max_OtherBlues 5
  130.     zone_table(max_OtherBlues) OtherBlues;
  131.     bool RndStemUp;
  132.     stem_table(1) StdHW;
  133.     stem_table(1) StdVW;
  134. #define max_StemSnap 12
  135.     stem_table(max_StemSnap) StemSnapH;
  136.     stem_table(max_StemSnap) StemSnapV;
  137.     /* Additional information for Multiple Master fonts */
  138. #define max_WeightVector 16
  139.     float_array(max_WeightVector) WeightVector;
  140. };
  141.  
  142. #define gs_type1_data_s_DEFINED
  143.  
  144. struct gs_font_type1_s {
  145.     gs_font_base_common;
  146.     gs_type1_data data;
  147. };
  148.  
  149. extern_st(st_gs_font_type1);
  150. #define public_st_gs_font_type1()    /* in gstype1.c */\
  151.   gs_public_st_suffix_add1_final(st_gs_font_type1, gs_font_type1,\
  152.     "gs_font_type1", font_type1_enum_ptrs, font_type1_reloc_ptrs,\
  153.     gs_font_finalize, st_gs_font_base, data.proc_data)
  154.  
  155. /* Export font procedures so they can be called from the interpreter. */
  156. font_proc_glyph_info(gs_type1_glyph_info);
  157.  
  158. #endif /* gxfont1_INCLUDED */
  159.